<%= form_for(@product, :method => "put", :html => {:id=> "product_edit_form", :class => "form"}) do |f| %>
	<% if @product.errors.any? %>
		<div id="error_explanation">
		<h2>共有<%= @product.errors.count %>错误，请按下面的提示修正先!!</h2>
			<ul>
				<% @product.errors.full_messages.each do |msg| %>
					<li><img src="/assets/error_01.png"><%= msg %></li>
				<% end %>
			</ul>	
		</div>
	<% end %>
	<p class="notice">
	<% if flash[:notice] != nil %>
		<img src="/assets/error_01.png">&nbsp;<%= flash[:notice] %>
	<% end %>
	</p>
	<div class="field_name width600" style="margin-left: 47px">
		<span><%= f.label :title, '名称' %><em>*</em></span>
		<%= f.text_field :title, :class => "text required", :maxlength => "32"%>
	</div>
	<div class="field_name width600" style="margin-left: 47px">
		<dl class="topitems">
			<dt><%= f.label :category, '种类' %><em>*</em></dt>
			<%= f.text_field :category, :class => "text required",:style =>"margin-left: 12px; width: 100px;", :readonly => true %>
			<%= f.text_field :sub_category, :class => "text required",:style =>"margin-left: 12px; width: 100px;", :readonly => true  %>
			<dd style="width: 400px;margin-left: 56px;margin-top: 10px;">
				<ul>
					<li id="red_wine" class="category">
						<a href="#" >红葡萄酒</a>
					</li>
					<li id="white_wine" class="category">
						<a href="#">白葡萄酒</a>
					</li>
				</ul>
			</dd>
		</dl>
		<dl class="subitems">
			<dt></dt>
			<dd style="width: 400px">
				<ul id="red_wine_sub_items" class="sub-wine-items" style="margin-left: 56px; display: none;">
					<li class="sub_category">
						<a href="#">干红</a>
					</li>
					<li class="sub_category">
						<a href="#">半干红</a>
					</li>
					<li class="sub_category">
						<a href="#">干甜红</a>
					</li>
					<li class="sub_category">
						<a href="#" >甜红</a>
					</li>
					<li class="sub_category">
						<a href="#">干甜搭</a>
					</li>
				</ul>
				<ul id="white_wine_sub_items" class="sub-wine-items"  style="margin-left: 58px; display: none;">
					<li class="sub_category">
						<a href="###">干白</a>
					</li>
					<li class="sub_category">
						<a href="#">半干白</a>
					</li>
					<li class="sub_category">
						<a href="#">干甜白</a>
					</li>
					<li class="sub_category">
						<a href="#">甜白</a>
					</li>
					<li class="sub_category">
						<a href="#">贵腐酒</a>
					</li>
					<li class="sub_category">
						<a href="#">干甜搭</a>
					</li>
				</ul>
			</dd>
		</dl>
	</div>
	<div class="field_name width600" style="margin-left: 34px;">
		<dl class="topitems">
			<dt><%= f.label :orign_country, '原产国' %><em>*</em></dt>
			<%= f.text_field :orign_country, :class => "text required",:style =>"margin-left: 12px; width: 100px; float: left;", :readonly => true %>
			<dd style="width: 400px;float: left;clear: both;margin-left: 56px;margin-top: 10px;">
				<ul style="margin-left: 13px;">
					<li id="french" class="contry">
						<a href="#">法国</a>
					</li>
					<li id="italy" class="contry">
						<a href="#">意大利</a>
					</li>
					<li id="australian" class="contry">
						<a href="#">澳大利亚</a>
					</li>
					<li id="germany" class="contry">
						<a href="#">德国</a>
					</li>
					<li id="america" class="contry">
						<a href="#">美国</a>
					</li>
					<li id="spain" class="contry">
						<a href="#">西班牙</a>
					</li>
					<li id="chile" class="contry">
						<a href="#">智利</a>
					</li>
					<li id="new-zealand" class="contry">
						<a href="#">新西兰</a>
					</li>
					<li id="argentina" class="contry">
						<a href="#">阿根廷</a>
					</li>
					<li id="south-africa" class="contry">
						<a href="#">南非</a>
					</li>
						<li id="austria" class="contry">
						<a href="#">奥地利</a>
					</li>
					<li id="portugal" class="contry">
						<a href="#">葡萄牙</a>
					</li>
					<li id="canada" class="contry">
						<a href="#">加拿大</a>
					</li>
					<li id="hungary" class="contry">
						<a href="#">匈牙利</a>
					</li>
					<li id="greece" class="contry">
						<a href="#">希腊</a>
					</li>
				</ul>
			</dd>
		</dl>
	</div>
	<div class="field_name width600" style="margin-left: 34px;">
		<span><%= f.label :orign_area, '原产地' %></span>
		<%= f.text_field :orign_area, :class => "text", :maxlength => "32", :style => "margin-left: 28px; width: 200px;" %>
	</div>
	<div class="field_name width600">
		<span><%= f.label :reference_year, '参考年份' %><em>*</em></span>
		<%= f.text_field :reference_year, :class => "number required", :maxlength => "5" %>
		<span style="margin-left: 10px">年 (E.g. 2009年)</span>
	</div>
	<div class="field_name width600"  style="margin-left: 34px;">
		<span><%= f.label :alcoholic, '酒精度' %><em>*</em></span>
		<%= f.text_field :alcoholic, :class => "number required", :maxlength => "5" %>
		<span style="margin-left: 10px">% (E.g. 13.5%)</span>
	</div>
	<div class="field_name width600"  style="margin-left: 47px;">
		<span><%= f.label :capacity, '容量' %><em>*</em></span>
		<%= f.text_field :capacity, :class => "number required", :maxlength => "4" %>
		<span style="margin-left: 10px">ml (E.g. 750 ml)</span>
	</div>
	<div class="field_name width600"  style="margin-left: 47px;">
		<span><%= f.label :price, '价格' %><em>*</em></span>
		<%= f.text_field :price, :class => "number required", :maxlength => "4" %>
		<span style="margin-left: 10px">￥</span>
	</div>
		<div class="field_name width600"  style="margin-left: 47px;">
		<span><%= f.label :vender, '酒庄' %></span>
		<%= f.text_field :vender, :class => "text", :maxlength => "32", :style => "margin-left: 28px; width: 200px;" %>
	</div>
	<div class="actions width600">
			<%= f.submit "更新", :class => 'create_button', :id => 'product_update_button' %>
	</div>
	<div class="control_bar width600">
		<%= link_to '所有宝贝', products_path %>
		<%= link_to '查看宝贝', product_path(@product) %>
	</div>
<% end %>






